package projorientado.ocr.vfeature.impl.comparator;

import projorientado.ocr.vfeature.FeaturesComparator;
import projorientado.ocr.vfeature.FeaturesComparatorProvider;
import projorientado.spi.ServiceProvider;

public class BasicFeaturesComparator implements ServiceProvider<FeaturesComparator> {

    private static final BasicFeaturesComparator instance = new BasicFeaturesComparator();
    
    static {
        FeaturesComparatorProvider.getInstance().registerServiceProvider("basicFeaturesComparator", instance);
    }
    
    private BasicFeaturesComparator() {
        
    }
    
    public static BasicFeaturesComparator getInstance() {
        return instance;
    }
    
    public FeaturesComparator getService(String s) {
        if(s.equalsIgnoreCase("euclidean")) {
            return EuclideanComparator.instance;
        } else if(s.equalsIgnoreCase("correlation")) {
            return CorrelationComparator.instance;
        }
        return null;
    }

}
